package game.tileMap.model.vo
{
	public class MonsterVo
	{
		public var id:int
	    public var name:String,battler_name:String
	    public var battler_hue:Number;
	    public var maxhp:int
	    public var maxmp:int
	    public var atk:Number,def:Number
	    public var spi:Number;
	    public var agi:Number,hit:Number,eva:Number;
	   
	    public var exp:Number;
	    public var gold:Number
	    public var drop_item1:XML,drop_item2:XML
	    public var levitate:Boolean
	    public var has_critical:Boolean
	    public var element_ranks:String;
	    public var state_ranks:String;
	    public var actions:XML;
	    public var note:String;

		public function MonsterVo(monster_xml:XML){
			init(monster_xml)
		}
		
		private function init(data:XML):void{
			id = data.id;
		    name = data.name
		    battler_name = data.battler_name
		    battler_hue = data.battler_hue
		    maxhp = data.maxhp
		    maxmp = data.maxmp
		    atk = data.atk
		    def = data.def
		    spi = data.spi
		    agi = data.agi
		    hit = data.hit
		      eva = data.eva
		      exp = data.exp
		      gold = data.gold
		      drop_item1 = data.drop_item[0]
		      drop_item2 = data.drop_item[1]
		      levitate = Boolean(data.levitae);
		      has_critical = Boolean(data.has_critical);
		      element_ranks = data.element_ranks;
		      state_ranks = data.state_ranks;
		   //   actions = data.actions;
		      note = data.note

		}
		
		//获取属性修正值
		public function getElementRate(element_id:int):int{
			var rank:String = element_ranks.charAt(element_id-1);
			var rankRate:Object={A:200,B:150,C:100,D:50,E:0,F:-100}
			//undefined会转为0
			var result:int = rankRate[rank];
			return result
		}
	}
}